<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/vue/2.5.18-beta.0/vue.js"></script>

</head>
<body>
    <div id="app">
        <item @handle = "handleClick"></item>
    </div>
    <script>
        var item={
            data(){
                return{
                    msg:"child"
                }
            },
            template:"<div @click='handleClick'>{{msg}}</div>",
            methods:{
                handleClick(){
                    /* 给父组件自定义一个事件,向父组件传参 */
                    this.$emit("handle",this.msg);
                }
            }
        }
        new Vue({
            el:"#app",
            components:{
                item
            },
            methods:{
                handleClick(options){
                    console.log(options)
                }
            }
        })
    </script>
</body>
</html>